package java_1_10.interface_test;

public class Animal implements Cloneable{
    private String name;
    //clone()
    @Override
    protected Animal clone() throws CloneNotSupportedException {
        return (Animal)super.clone();
    }
    public static void main(String[] args) throws CloneNotSupportedException {
        Animal animal1=new Animal();
        animal1.name="佩奇";
        Animal animal2=animal1.clone();
        System.out.println(animal1==animal2);
        System.out.println(animal1.name);
    }
}
